/*
========================================================================
 Name        : SingaporeBusAppUi.h
 Author      : 
 Copyright   : Your copyright notice
 Description : 
========================================================================
*/
#ifndef SINGAPOREBUSAPPUI_H
#define SINGAPOREBUSAPPUI_H

// [[[ begin generated region: do not modify [Generated Includes]
#include <aknviewappui.h>
// ]]] end generated region [Generated Includes]

// [[[ begin generated region: do not modify [Generated Forward Declarations]
class CPublicTransportMapContainerView;
class CSingaporeBusSettingItemListView;
class CSingaporeBusAccessPointsPriorityListBoxView;
// ]]] end generated region [Generated Forward Declarations]

class CSingaporeBusServicesView;
class CSingaporeBusStopsView;
class CSingaporeBusServicesArrivalTimeView;
class CSingaporeBusServiceRouteView;
class CSingaporeBusRouteView;
class CSingaporeBusFavoritesView;

#include "akntabgrp.h"
#include "aknnavide.h"
#include "akntabobserver.h"
#include <akniconarray.h>
#include <euserhl.h>

/**
 * @class	CSingaporeBusAppUi SingaporeBusAppUi.h
 * @brief The AppUi class handles application-wide aspects of the user interface, including
 *        view management and the default menu, control pane, and status pane.
 */
class CSingaporeBusAppUi : public CAknViewAppUi, public MAknTabObserver
	{
public: 
	// constructor and destructor
	CSingaporeBusAppUi();
	virtual ~CSingaporeBusAppUi();
	void ConstructL();

public:
	// from CCoeAppUi
	TKeyResponse HandleKeyEventL(
				const TKeyEvent& aKeyEvent,
				TEventCode aType );

	// from CEikAppUi
	void HandleCommandL( TInt aCommand );
	void HandleResourceChangeL( TInt aType );

	// from CAknAppUi
	void HandleViewDeactivation( 
			const TVwsViewId& aViewIdToBeDeactivated, 
			const TVwsViewId& aNewlyActivatedViewId );
	
	void HandleForegroundEventL(TBool aForeground);
	
	void SwitchCustomLayout1(CEikStatusPane* aStatusPane);
	
	LManagedPtr<CAsyncCallBack> iTabCallback;
	TInt TabCallbackL();
	TVwsViewId iNewlyActivatedViewId;
	TBool iBackCommand;
	
	TBool iAknSplitInputEnabled;
	
	struct CBackViewQueueItem
		{
		TUid iViewId;
		TUid iCustomMessageId;
		CBase* iCustomInfo;
		HBufC8* iCustomMessage;
		CBackViewQueueItem() : iCustomMessage(NULL) { }
		~CBackViewQueueItem() { delete iCustomMessage; }
		};
	
	
	
	void PushBackViewL(TUid aViewId, TUid aCustomMessageId, CBase* aCustomInfo);
	
	RArray<CBackViewQueueItem*> iBackViewQueue;

	RArray<CBackViewQueueItem*> iListTabViewArray, iRouteTabViewArray, iFavoritesTabViewArray;
	
	void NotifyJourneyPlannerQueryAnswerL();
	void NotifyPositionChange();
	
	CAknNavigationDecorator* iRouteTabDecorator, * iListTabDecorator;
	
	

private:
	// From MAknTabObserver
	void TabChangedL( TInt aIndex );	
	void ShowListTabGroup(TInt aActive);
	void ShowRouteTabGroup(TInt aActive);
	void HideTabGroup();
	
	void InitializeContainersL();
	// [[[ begin generated region: do not modify [Generated Methods]
public: 
	static TInt RunRecomputeRouteQueryL( const TDesC* aOverrideText = NULL );
	static void CreateSelectTravelOptionQueryItemL( 
			TDes& aBuffer,
			
			const TDesC& aMainText );
	static void CreateSelectTravelOptionQueryResourceArrayItemL( 
			TDes& aBuffer, 
			TInt aResourceId );
	static CDesCArray* InitializeSelectTravelOptionQueryLC();
	static CArrayPtr< CGulIcon >* SetupSelectTravelOptionQueryIconsLC();
	static TInt RunSelectTravelOptionQueryL( 
			const TDesC* aOverrideText = NULL, 
			CDesCArray* aOverrideItemArray = NULL,
			CArrayPtr< CGulIcon >* aOverrideIconArray = NULL );
	// ]]] end generated region [Generated Methods]
	
	// [[[ begin generated region: do not modify [Generated Instance Variables]
private: 
	CPublicTransportMapContainerView* iPublicTransportMapContainerView;
	CSingaporeBusSettingItemListView* iSingaporeBusSettingItemListView;
	CSingaporeBusAccessPointsPriorityListBoxView* iSingaporeBusAccessPointsPriorityListBoxView;
	// ]]] end generated region [Generated Instance Variables]
	
	CSingaporeBusServicesView* iSingaporeBusServicesView;
	CSingaporeBusStopsView* iSingaporeBusStopsView;
	CSingaporeBusServicesArrivalTimeView* iSingaporeBusServicesArrivalTimeView;
	CSingaporeBusServiceRouteView* iSingaporeBusServiceRouteView;
	CSingaporeBusRouteView* iSingaporeBusRouteView;
	CSingaporeBusRouteView* iSingaporeBusRouteView2;
	CSingaporeBusFavoritesView* iSingaporeBusFavoritesView;
	CSingaporeBusFavoritesView* iSingaporeBusFavoritesView2;
	
	// [[[ begin [User Handlers]
protected: 
	// ]]] end [User Handlers]
	
	enum TSelectTravelOptionQueryImages
		{
		// [[[ begin generated region: do not modify [Generated Enums]
		ESelectTravelOptionQueryFirstUserImageIndex
		
		// ]]] end generated region [Generated Enums]
		
		};
	};

#endif // SINGAPOREBUSAPPUI_H			
